<template>
  <div id="desktop">
    <top></top>

    <window v-for="(win,index) in windows" :window="win" :key="win.windowId" v-if="win.show"
           ></window>
    <file-view></file-view>
  </div>
</template>

<script>
import Top from "./components/top/Index";
import window from "./components/window";
import fileView from "./components/fileView";
import sys from "./js/windowManager";

export default {
  name: 'Desktop',
  components: {
    Top,
    window,
    fileView
  },
  data() {
    return {
      //windowId 起点值
      windowId: 1,
      windows: [],
      windowTopZIndex: 201,
    }
  },
  created() {
    sys.setWindows(this.windows)
  },
  methods: {
    // windowClose(window) {
    //       sys.destroyedWidow(window);
    // },
    // windowFocus(window) {
    //   console.log("windowFocus")
    //   window.zIndex = ++this.windowTopZIndex
    // },

  },
  mounted() {
    sys.setContentMenu(this.$contentMenu)
  },
  destroyed() {
  }
}
</script>

<style>
#desktop {
  width: 100vw;
  height: 100vh;
  background: url("./assets/壁纸.jpg") no-repeat;
  background-size: 100% 100%;
  user-select: none;
}
</style>
